package com.diy.sigmund.diycommon.spring.interceptor;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author ylm-sigmund
 * @since 2022/5/22 13:48
 */
public class MyMethodInterceptor implements MethodInterceptor {

    private static final Logger log = LoggerFactory.getLogger(MyMethodInterceptor.class);

    @Override
    public Object invoke(MethodInvocation methodInvocation) throws Throwable {
        log.info("MyMethodInterceptor打印执行的方法:{}", methodInvocation.getMethod().getName());
        return methodInvocation.proceed();
    }
}
